<div class="deal-view-inner-block clearfix">
      <div class="main-shad">&nbsp;</div>
      <div class="side1">
        <div class="block1 clearfix">
          <div class="side1-tl">
            <div class="side1-tr">
              <div class="side1-tm"> </div>
            </div>
          </div>
          <div class="side1-cl">
            <div class="side1-cr">
              <div class="block1-inner">
              <h2 class="title"><?php echo $titlepage?></h2>	
              
                <div class="gallery-block">
    				<div id='js-gallery'>
    					<a><?php echo $html->image($deal['Deal']['image']);?></a>
    				</div>
    			</div>
                <div class="deal-block clearfix">
                       <dl class="deal-value clearfix">
    					 <dt><?php echo __l('Value');?></dt>
    					 <dd><?php echo $html->siteCurrencyFormat($html->cCurrency($deal['Deal']['original_price'],false))?></dd>
    				  </dl>
    				  <dl class="deal-discount clearfix">
    					<dt><?php echo __l('Discount');?></dt>
    					<dd><?php echo $html->cInt($deal['Deal']['discount_percentage']) . "%"; ?></dd>
    				  </dl>
    				  <dl class="deal-save clearfix">
    					<dt><?php echo __l('You Save');?></dt>
    					<dd><?php echo $html->siteCurrencyFormat($html->cCurrency($deal['Deal']['savings'])) ?></dd>
    	       		  </dl>
                 </div>
                <div class="buy-block clearfix">
                  <div class="clearfix">
                      <p class="price"><?php echo $html->siteCurrencyFormat($html->cCurrency($deal['Deal']['discounted_price']))?></p>
                      	<?php 
						 echo $html->link(__l('Buy Now'), array('controller'=>'deals','action'=>'buy',$deal['Deal']['id']), array('title' => __l('Buy Now'),'class' =>'button'));
						?>
                   </div>
                </div>
                <div class="clearfix">
                    <div class="section1">
                    <div class="price-block -block">
                    
                    <div class="bought-block clearfix">
                          
                        <div class="progress-tl">
                          <div class="progress-tr">
                            <div class="progress-tm"> </div>
                          </div>
                        </div>
                        
                        <div class="progress-inner clearfix">
                          <p class="progress-desc"><?php echo $deal['Deal']['quantity_in_stock']?> quanlity in stock.</p>
                         </div>
                         
                        <div class="progress-bl">
                          <div class="progress-br">
                            <div class="progress-bm"> </div>
                          </div>
                        </div>
                      </div>
                      <div class="progress-block clearfix">
                        <div class="progress-tl">
                          <div class="progress-tr">
                            <div class="progress-tm"> </div>
                          </div>
                        </div>
                        <div class="progress-inner clearfix">
                                <dl class="progress-list">
                                    <dt><?php echo __l('Time left to buy');?></dt>
                                    <dd>
                                        <div class="js-widget-deal-end-countdown">&nbsp;</div>
                                        <span class="js-time hide"><?php
                                            echo $end_time = intval(strtotime($deal['Deal']['end_date'].' GMT') - time());
                                        ?></span>
                                    </dd>
                                 </dl>
                                <div class="pg-img"><?php echo $html->image("clock-img.png", array('alt'=> __l('[Image: Progress]'), 'title' => __l('Progress'))); ?></div>
                          </div>
                        <div class="progress-bl">
                          <div class="progress-br">
                            <div class="progress-bm"> </div>
                          </div>
                        </div>
                      </div>

                      <div class="share-block1 share-block clearfix">
                       <span><?php echo __l('Share This Deal: '); ?></span>
                        <ul class="share-list">
                            <?php
            					if(Configure::read('site.city_url') == 'prefix'):
            						$bityurl = '';
            					else:
            						$bityurl = '';
            					endif;
            				?>
                            <li class="quick"><?php echo $html->link(__l('Quick! Email a friend!'), 'mailto:?body='.__l('Check out the great deal on ').Configure::read('site.name').' - '.Router::url('/', true).'deals/adility/'.$deal['Deal']['id'].'&amp;subject='.__l('I think you should get ').Configure::read('site.name').__l(': ').$deal['Deal']['discount_percentage'].__l('% off'), array('target' => 'blank', 'title' => __l('Send a mail to friend about this deal'), 'class' => 'quick'));?></li>
							<li class="twitter-frame"><a href="http://twitter.com/share?url=<?php echo $bityurl;?>&amp;text=<?php echo urlencode_rfc3986($deal['Deal']['name']);?>&amp;lang=en&amp;via=<?php echo Configure::read('site.name'); ?>" data-count="none" class="twitter-share-button"><?php echo __l('Tweet!');?></a></li>
                            <li class="share-list"><fb:like href="<?php echo Router::url('/', true).'deal/adility/'.$deal['Deal']['id'];?>" layout="button_count" font="tahoma"></fb:like></li>
                        </ul>
                      </div>
                    
                    </div>
                  </div>
                  
                   <div class="section2">
                    <div class="fine-print-block">
                        <h3><?php echo __l('The Fine Print');?></h3>
                        <?php echo $deal['Deal']['fine_print']?>
                    </div>
                    <div class="highlight-block">
                      <h3><?php echo __l('Highlights');?></h3>
                    </div>
                  </div>
                </div>
                
                </div>
            </div>
        </div>
        <div class="side1-bl">
            <div class="block2-br">
              <div class="side1-bm">
                <div class="block2-bottom"></div>
              </div>
            </div>
          </div>
        </div>
        
        <div class="block2 clearfix">
          <div class="side1-tl">
            <div class="block2-tr">
              <div class="side1-tm">
                <div class="block2-top"></div>
              </div>
            </div>
          </div>
          <div class="side1-cl">
            <div class="block2-cr">
              <div class="block2-inner clearfix">
                <div class="block2-l">
                   <h3><?php echo __l('Description');?></h3>
                    <?php echo $html->cHtml($deal['Deal']['description']);?>
                  <div class="review-block clearfix">
                    <?php if(!empty($deal['Deal']['review'])){?>
        				<h3><?php echo __l('Reviews');?></h3>
        				<div class="big-text"><?php foreach($deal['Deal']['review'] as $i => $review)
                        {
                            echo  $review->content.' - '.$review->author_name.' from : '.$review->source_url;
                        } 
                        ?></div>
			      <?php }?>				
        		</div>
                </div>
                <div class="block2-r">
                    <h3><?php echo __l('Address')?></h3>
                    <address>
                        <span class="street-name">
                            <?php echo $deal['Company']['address1']?>
                        </span>
                        <span><?php echo $deal['Company']['City']['name']?></span>
                        <span><?php echo $deal['Company']['Country']['name']?></span>
                    </address>
				   
				 
                </div>
                </div>                
              </div>
            </div>
          <div class="side1-bl">
            <div class="block2-br">
              <div class="side1-bm">
                <div class="block2-bottom"></div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <?php echo $this->element('../deals/sidebar', array('deal' => $deal, 'count' => $count, 'get_current_city' => $get_current_city, 'cache' => array('time' => Configure::read('site.element_cache'))));?>
</div>

<div id="fb-root"></div>
	<script type="text/javascript">
	  window.fbAsyncInit = function() {
		FB.init({appId: '<?php echo Configure::read('facebook.app_id');?>', status: true, cookie: true,
				 xfbml: true});
	  };
	  (function() {
		var e = document.createElement('script'); e.async = true;
		e.src = document.location.protocol +
		  '//connect.facebook.net/en_US/all.js';
		document.getElementById('fb-root').appendChild(e);
	  }());
	</script>